import 'package:flutter/material.dart';

import 'languages.dart';

class CountryPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        automaticallyImplyLeading: false,
        brightness: Brightness.light,
        title: Text("Select your language",style: TextStyle(color: Colors.black),),
        centerTitle: true,
        elevation: 0,
        backgroundColor: Colors.transparent,
      ),
      body: Container(
        margin: EdgeInsets.only(left: 16,right: 16,top: 20),
        decoration: BoxDecoration(
          color: Color(0xfff1f1f1),
          borderRadius: BorderRadius.circular(10)
        ),
        width: double.infinity,
        height: double.infinity,
        child: ListView.builder(
          padding: EdgeInsets.only(top: 10,bottom: 20),
          physics: BouncingScrollPhysics(),
          itemBuilder: (context,index)=>ListTile(
            onTap: ()=>Navigator.pop(context,languagesList[index]),
            trailing: Icon(Icons.navigate_next_rounded),
          title: Text(languagesList[index],style: TextStyle(fontWeight: FontWeight.w500),),
          leading: ClipRRect(
              borderRadius: BorderRadius.circular(50),
              child: Image.asset("images/${languagesList[index]}.png",width: 40,height: 40,fit: BoxFit.cover,)),
        ),
          itemCount: languagesList.length,
        ),
      ),
    );
  }
}
